{% extends 'admin/master.html' %}
{% import 'admin/lib.html' as lib with context %}

{% block body %}
    {% block navlinks %}
        <ul class="nav nav-tabs">
            <li>
                <a href="{{ return_url }}">{{ _gettext('List') }}</a>
            </li>
            {%- if admin_view.can_create -%}
                <li>
                    <a href="{{ get_url('.create_view', url=return_url) }}">{{ _gettext('Create') }}</a>
                </li>
            {%- endif -%}
            {%- if admin_view.can_edit -%}
                <li>
                    <a href="{{ get_url('.edit_view', id=request.args.get('id'), url=return_url) }}">{{ _gettext('Edit') }}</a>
                </li>
            {%- endif -%}
            <li class="active">
                <a href="javascript:void(0)">{{ _gettext('Details') }}</a>
            </li>
        </ul>
    {% endblock %}

    {% block details_table %}
        <div class="article-content-box">
            <div class="article-header-box">
                <div>
                    <h1 class="article-title">{{ get_value(model, 'title') }}</h1>
                </div>
                <div class="article-info-box">
                    <div>
                        <span>{{ get_value(model, 'created_by') }}</span>
                        <span>发布于 {{ get_value(model, 'created_at') }} &nbsp;</span>
                    </div>
                    <div style="width: 100%; margin-bottom: 4px;">
                        <span style="font-size: 14px; line-height: 24px;">标签：{{ get_value(model, 'tags') }}</span>
                        <a class="tag-link" href="" target="_blank">sample</a>
                    </div>
                </div>
            </div>
            <div class="article-content">
                <pre>{{ get_value(model, 'content')|safe }}</pre>
            </div>
        </div>
    {% endblock %}
{% endblock %}

{% block tail %}
    {{ super() }}
    <script src="{{ admin_static.url(filename='admin/js/details_filter.js', v='1.0.0') }}"></script>
    <style type="text/css">
        .article-content-box {
            position: relative;
            padding: 0 24px 16px;
            background: #fff;
            border-radius: 2px;
            margin: 0;
        }
        .article-header-box {
            border-bottom: 1px solid #f5f6f7;
            padding-top: 8px;
            background-color: #fff;
        }
        .article-title {
            font-size: 28px;
            word-wrap: break-word;
            font-weight: 600;
            word-break: break-all;
            margin: 0 0 8px;
            font-family: 'PingFang SC', 'Microsoft YaHei', 'SimHei', 'Arial', 'SimSun';
        }
        .article-info-box {
            background-color: #f8f8f8;
        }
        .article-info-box a.tag-link {
            box-sizing: border-box;
            margin-right: 8px;
            padding: 3px 6px;
            font-size: 12px;
            background-color: #fff;
            border: 1px solid #eaeaef;
            height: 24px;
            line-height: 17px;
            border-radius: 2px;
            display: inline-block;
        }
        .article-content {
            position: relative;
            padding-top: 16px;
        }
    </style>
{% endblock %}
